<template>
	<view class="company-auth-main">
		<view class="common-tips-box">
			<view class="t1">公司认证</view>
			<view class="t2">认证全部通过后，将向应聘者展示</view>
		</view>
		<view class="list-box">
			<view class="job-box">
				<view class="tit">工商信息</view>
				<navigator class="navigator-box" hover-class="hoverClass2" url="/pages/recruit/business-credentials/index">
					<view :class="{'picker': true, 'tips-txt': !form.full_name}">
						{{ form.full_name || '请填写工商信息' }}
						<view class="pull-right">{{form.full_name ? '' : '去填写'}}<text class="iconfontPT iconZp-toright"></text></view>
					</view>
				</navigator>
			</view>
			<view class="job-box">
				<view class="tit">企业授权书和营业执照认证</view>
				<navigator class="navigator-box" hover-class="hoverClass2" url="/pages/recruit/upload-auth/index">
					<view :class="{'picker': true, 'tips-txt': !form.financingStatus}">
						{{ form.state == 0 ? '上传企业授权书和营业执照' : form.state == 1 ? '已通过审核' : '已上传' }}
						<view class="pull-right">{{form.state != 0 ? '查看' : '去上传'}}<text class="iconfontPT iconZp-toright"></text></view>
					</view>
				</navigator>
			</view>
		</view>
		<view v-if="form.state == 3" class="caution-box"><text class="iconfontPT iconZp-zhuyi"></text>上传成功，请等待后台审核...</view>
	</view>
</template>

<script>
	import {
		getAuthenticationSrv
	} from '../../../apis/recruit/index.js'

	export default {
		data() {
			return {
				state: 0, // 0未录入 1审核通过 2审核失败 3待审核
				id: '',
				form: {}
			}
		},
		onLoad(options) {
			this.id = options.id
			console.log(this.id)
		},
		onShow() {
			let params = {
				id: this.id
			}
			this.getInitDataInfo(params);
		},
		onUnload() {
			uni.removeStorageSync('authentication')
		},
		methods: {
			getInitDataInfo(params) {
				let _this = this;
				getAuthenticationSrv(params).then(res => {
					if (res.code == 1) {
						res.data.id = _this.id;
						_this.form = res.data
						uni.setStorageSync('authentication', res.data);
					}
				})
			},
		}
	}
</script>

<style lang="less">
	.tips-txt {
		color: #989898;
	}

	.company-auth-main {
		padding: 0 30rpx;
	}

	.job-box {
		padding: 38rpx 0 0;
		box-shadow: 0 1rpx 0.5rpx -1rpx #CCCCCC;

		.tit {
			font-size: 24rpx;
			line-height: 24rpx;
		}

		navigator {
			font-size: 30rpx;
			line-height: 30rpx;
			padding: 20rpx 0 30rpx;

			.pull-right {
				font-size: 24rpx;
				line-height: 24rpx;
				color: #E41805;

				.iconfontPT {
					font-size: 24rpx;
					line-height: 24rpx;
					color: #999;
					margin-left: 18rpx;
				}
			}
		}
	}

	.caution-box {
		margin-top: 16rpx;
		color: #fb830e;
		font-size: 28rpx;

		.iconfontPT {
			margin-right: 14rpx;
			font-size: 28rpx;
		}
	}
</style>
